#include "cv.h"
#include "highgui.h"
#include <stdio.h>
#include <malloc.h>
#include <vector>
#include <string>

using namespace std;

struct point{
double px;
double py;
double r;
}; 

class CamCal{

public:
	CamCal(){};
	void init(int x, int y);
	bool read(const char* filename);
	bool write(const char* filename);
	void compute();
	double pixToDistance(double x,double y);
	void error();
	vector<point> data;
protected:
	CvMat *CA;
	CvMat *Cb;
	CvMat *Cx;
	int row;
	int col;
	int centerx;
	int centery;
};